/* ***********************
 * Version: MPL 1.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is SiteLicense.js module.
 *
 * The Initial Developer of the Original Code is Rob Gerns.
 *
 * Portions created by the Initial Developer are Copyright (C) 2010
 * the Initial Developer. All Rights Reserved.
 *
 **************************/

/*************************************************
* Function Name(s): SiteLicense(); writeLicense()
*
* Purpose:
* Check to see if there is a license defined in the 
* 'brief' section of the Oister file.  If there is
* create the necessary div and write the license  
* inside the div.
**************************************************/

function siteLicense(xmlDocument){	
    
 //Check to see if a license was included
 var checkLicense = xmlDocument.getElementsByTagName("license");
    
 //If so, get it's value, otherwise make it blank
 if(checkLicense.length == 1) {
  var license = checkLicense[0].firstChild.nodeValue;
		
	if(license != undefined && license != null){
		
	 //Call the writeTagline function to create the appropriate div
	 writeLicense(license);
		
	} 
	
 } 
	
}

function writeLicense(license){

 //If there is a license, create the div and write the license inside
 divLicense = document.createElement("div");
 licenseId = divLicense.id = "license";
 divLicense.className = "license";
 document.getElementById('begin').appendChild(divLicense);
 document.getElementById(licenseId).innerHTML = "<pre>"+license+"</pre>";
   
}